{% extends "base.html" %}

{% block title %}/ {{ this_month_dt|date:"F Y"}}{% endblock %}

{% block header %}/ {{ this_month_dt|date:"F Y"}}{% endblock %}

{% block content %}
<div id="time_series" class="sec">
	<ul class="timeline_wide">
		{% for d in recalls_by_day %}
		<li>
			<a href="#day{{ forloop.counter }}" title="{{ d }} recalls">
				<span class="label">{{ forloop.counter }}</span>
				{% if forloop.first %}<span class="bottom_label">{{ this_month_dt|date:"F Y"}}</span>{% endif %}
				<span class="count" style="height: {% widthratio d recalls_max 100 %}%;">({{ d }})</span>
			</a>
		</li>
		{% endfor %}
	</ul>
</div>

<div id="main_content" class="right">
	<div id="recent_recalls" class="sec">
		<ul>
			{% for r in recalls %}
			<li{% ifchanged %} id="day{{ r.when|date:"j" }}"{% endifchanged %}>
				<div class="date left">{% ifchanged %}{{ r.when|date:"N j Y" }}{% endifchanged %}&nbsp;</div>
				<div class="info left">
					<div class="product">
						{% if r.description %}{{ r.description|safe }}{% else %}{{ r.brand_name|safe }}{% endif %} &mdash; 
						<a href="{% url recallviewer.views.company_view r.company.id %}">{{ r.company.name|safe }}</a></div>
					<div class="reason">{{ r.reason|default:"Unknown" }}</div>
					<div class="summary">{{ r.summary|default:""|truncatewords:20|safe }}</div>
					<div class="press_release small">
						<a href="{% url recallviewer.views.recall_view r.id %}">#</a> / 
						Press release: {{ r.release_link|safe|urlizetrunc:20 }}
						{% if r.photo_link %}/ Photo: {{ r.photo_link|safe|urlizetrunc:20 }}{% endif %}
					</div>
				</div>
				<div class="clr"></div>
			</li>
			{% endfor %}
		</ul>
	</div><!-- @end recent_recalls -->
</div><!-- @end main_content -->

<div id="sidebar_content" class="left">
	<div id="aggregates" class="sec">
		<div id="recalls_this_year">
			<h2>Recalls Count</h2>
			<div class="big">{{ recalls_count }}</div>
		</div>
	</div>
	
	<div id="common_reasons" class="sec">
		<h2>The Reasons</h2>
		<ol>
			{% for r in reasons%}
			<li>
				{{ r.reason }} <span class="meta">({{ r.reason__count }})</span>
			</li>
			{% endfor %}
		</ul>
	</div><!-- @end common_reasons -->
</div><!-- @edn sidebar_content -->


{% endblock %}